import Vue from 'vue'
import Router from 'vue-router'
import WxArticle from 'view/article/WxArticle'
import Vote from 'view/vote/index'
import VoteApply from 'view/vote/apply'
import VoteRank from 'view/vote/rank'
import VoteItem from 'view/vote/item'
import Qiniu from 'view/qiniu/upload'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    // {
    //   path: '/',
    //   name: 'Hello',
    //   component: WxArticle
    // },
    {
      path: '/wx/i/s/:id',
      name: 'article',
      title: '文章详情',
      component: WxArticle
    },
    {
      path: '/wx/i/votes-:id',
      name: 'votes',
      title: '投票',
      component: Vote,
      children: [
        {
          path: '/wx/i/votes-:id-apply',
          name: 'vote-apply',
          title: '投票报名',
          component: VoteApply
        },
        {
          path: '/wx/i/votes-:id-rank',
          name: 'vote-rank',
          title: '投票排名',
          component: VoteRank
        },
        {
          // lr=瀑布流中是左边(l)还是右边(r) index=瀑布流中的下标
          path: '/wx/i/votes-:id-item-:itemId-:lr-:index',
          name: 'vote-item',
          title: '投票用户详情',
          component: VoteItem
        }
      ]
    },
    {
      path: '/qiniu',
      name: 'qiniu',
      title: 'qiniu',
      component: Qiniu
    }
  ]
})
